template <class T>
struct Delete
{
	void operator()(T* ptr)
	{
		delete ptr;
	}
};
template <class T,class D = Delete<T>>
class myUnique_ptr
{
public:
	myUnique_ptr(T* _ptr,D _d)
		:ptr(_ptr)
		,d(_d)
	{
	}
	myUnique_ptr(const myUnique_ptr<T,D>& u) = delete;
	myUnique_ptr<T,D>& operator=(const myUnique_ptr<T,D>& u) = delete;
	T* operator->()
	{
		return ptr;
	}
	T& operator*()
	{
		return *ptr;
	}
	~myUnique_ptr()
	{
		d(ptr);
	}

private:
	T* ptr;
	D d;
};


int main()
{
	auto f = [](int* ptr)->void {
		delete ptr;
	};
	//decltype(f) f2;//error
	//decltype(f) f2 = f; //正确
	f2(new int(3));
	//myUnique_ptr<int,decltype(f)> u(new int(1),f);
    return 0;
}